package com.wxf.producer;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Start {
    public static void main(String[] args) {
        ApplicationContext ac = new ClassPathXmlApplicationContext("spring-rabbitmq.xml");
        RabbitTemplate rabbitTemplate = ac.getBean("rabbitTemplate",RabbitTemplate.class);
        rabbitTemplate.convertAndSend("spring_direct_exchange","insert","路由模式，发给insert的");
        rabbitTemplate.convertAndSend("spring_direct_exchange","update","路由模式，发给update的");
    }
}
